
<?php
error_reporting(E_ALL);

include_once('controller/includes/constants.php');
include_once('controller/includes/Template.php');
?>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>CMS Sets Orverzicht</title>
        <link rel="stylesheet" href="styles/screen.css" type="text/css" charset="utf-8" media="screen" />
    </head>
    <body>
        <table border="0" cellspacing="5" cellpadding="5">
            <thead>
                <tr>
                    <th colspan="3"><?php include_once('controller/includes/header.php'); ?></th>
                </tr>
                <tr>
                    <th colspan="3"><a href="toepassing_add.php" >add toepassing</a></th>
                </tr>
            </thead>
            <tbody>


                <?php
// put your code here
                $q = new Query;
                $q
                        ->select('*'
                        )
                        ->from('`toepassingen`')
                        ->order_by(
                                array(
                                    '`toepassingen`.`sort` ASC',
                                )
                        )
                        ->run();

                $result = $q->run();
                $count = $q->get_selected_count();

                if (!($result && $count > 0)) {
                    echo 'No users found.' . "\n";
                } else {
                    while ($rows = mysql_fetch_object($result)) {

                        echo'<tr><td>' . $rows->sort . ' </td> 
            <td><a href="toepassing_edit.php?pid=' . $rows->toepassing_id . '">detail</a></td>
            <td><a href="toepassing_del.php?pid=' . $rows->toepassing_id . '">delete</a></td></tr>';
                    }
                }
                ?>



                <tr>
                    <td></td>
                    <td></td>
                    <td></td>
                </tr>
            </tbody>
        </table>

    </body>
</html>